﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;



namespace WP7toWordpressXMLRPC
{
    using System.Reflection;
    using CookComputing.XmlRpc;

    [XmlRpcUrl(WordpressWrapper.BlogUrl)]
    public class WordpressWrapper : XmlRpcClientProtocol
    {
        public const string BlogUrl = "http://MYWORDPRESSURL/xmlrpc.php";
        
        [XmlRpcBegin("metaWeblog.getRecentPosts")]
        public IAsyncResult BeginGetRecentPosts(int blogid, string username, string password, int numposts, AsyncCallback acb)
        {
            return this.BeginInvoke(MethodBase.GetCurrentMethod(), new object[] { 0, username, password, numposts }, acb, null);
        }

        [XmlRpcEnd]
        public XmlRpcStruct[] EndGetRecentPosts(IAsyncResult iasr)
        {
            XmlRpcStruct[] ret = (XmlRpcStruct[])this.EndInvoke(iasr);
            return ret;
        }
    }
   
}
